/**
 * ReportGear(2011)
 */
package com.reportgear.designer.ui.toolbar;

import java.awt.FlowLayout;

import javax.swing.JToolBar;

import com.reportgear.designer.action.ActionInterface;
import com.reportgear.designer.action.edit.MergeCellAction;
import com.reportgear.designer.action.edit.UnmergeCellAction;
import com.reportgear.designer.action.file.PagePreviewAction;
import com.reportgear.designer.action.file.PageSetupAction;
import com.reportgear.designer.action.file.PrintReportAction;
import com.reportgear.designer.action.style.GlobalStyleAction;

/**
 * 显示报表时工具栏
 * 
 * @version 1.0 2011-3-24
 * @author <a herf="lexloo@gmail.com">lexloo</a>
 * @since Report 1.0
 */
public class ShowToolBar extends JToolBar {

	public ShowToolBar() {
		super();

		this.initialize();
	}

	private void initialize() {
		this.setRollover(true);
		this.setLayout(new FlowLayout(FlowLayout.LEFT, 1, 1));
//		this.addAction(new NewReportAction());
//		this.addAction(new SaveReportAction());
//		this.addAction(new DeleteReportAction());
//		this.addSeparator();
		this.addAction(new PagePreviewAction());
		this.addAction(new PrintReportAction());
		this.addAction(new PageSetupAction());
		this.addSeparator();
		this.addAction(new MergeCellAction());
		this.addAction(new UnmergeCellAction());
		this.addSeparator();
		this.addAction(new GlobalStyleAction());
//		this.addSeparator();
//		this.addAction(new CloseAction());
	}

	/**
	 * 添加Action
	 * 
	 * @param action
	 */
	private void addAction(ActionInterface action) {
		this.add(action.createToolBarComponent());
	}
}
